package com.donleo.jpa.controller;

import com.donleo.jpa.common.CommonResult;
import com.donleo.jpa.entity.DeptEntity;
import com.donleo.jpa.service.IDeptServce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liangd
 * date 2020-12-04 09:22
 * code
 */
@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private IDeptServce deptServce;

    @GetMapping("/findAll")
    public CommonResult findAll(){
        List<DeptEntity> list = deptServce.findAll();
        return CommonResult.success(list);
    }
}
